import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 引入全局样式
import gloal from './assets/css/global.css'
//引入执行plugins/vant.js 来完成vant组件的导入和注册
import './plugins/vant.js'
//导入axios
import axios from 'axios'
// 配置请求的根路径
axios.defaults.baseURL = 'http://www.liulongbin.top:3005/'
//将axios挂载到Vue原型中
Vue.prototype.$http = axios;

Vue.config.productionTip = false

new Vue({
  store,
  router,
  render: h => h(App)
}).$mount('#app')

// 时间过滤器
Vue.filter('dateFormat', function (originVal) {
  const dt = new Date(originVal)

  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  const d = (dt.getDate() + '').padStart(2, '0')
  return `${y}-${m}-${d}`
})